<%@page pageEncoding="UTF-8" contentType="text/html; UTF-8" isELIgnored="false" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>修改客舱信息</title>
    <link rel="stylesheet" href="css/edit_cabin.css">
</head>
<body>
<div class="form-container">
    <%
        String id = request.getParameter("id");
        String name = request.getParameter("name");
        String food = request.getParameter("food");
        String service = request.getParameter("service");
        String handBaggage = request.getParameter("handBaggage");
        String checkedBaggage = request.getParameter("checkedBaggage");
        Double price = Double.valueOf(request.getParameter("price"));
        int capacity = Integer.parseInt(request.getParameter("capacity"));
        int booked = Integer.parseInt(request.getParameter("booked"));
        String flightId = request.getParameter("flightId");
    %>
    <h1>修改客舱信息</h1>
    <form action="editCabin" method="post">
        <input type="hidden" name="id" value="<%=id %>" required>
        <div class="form-row">
            <div class="form-group">
                <label for="name">客舱名：</label>
                <input type="text" id="name" name="name" value="<%=name %>" required>
            </div>
            <div class="form-group">
                <label for="food">餐食：</label>
                <input type="text" id="food" name="food" value="<%=food %>" required>
            </div>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label for="service">服务：</label>
                <input type="text" id="service" name="service" value="<%=service %>" required>
            </div>
            <div class="form-group">
                <label for="hand_baggage">手提行李限额：</label>
                <input type="text" id="hand_baggage" name="hand_baggage" value="<%=handBaggage %>" required>
            </div>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label for="checked_baggage">免费托运行李限额：</label>
                <input type="text" id="checked_baggage" name="checked_baggage" value="<%=checkedBaggage %>" required>
            </div>
            <div class="form-group">
                <label for="price">价格：</label>
                <input type="text" id="price" name="price" value="<%=price %>" required>
            </div>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label for="capacity">总容量：</label>
                <input type="text" id="capacity" name="capacity" value="<%=capacity %>" required>
            </div>
        </div>
        <input type="hidden" name="booked" value="<%=booked %>">
        <input type="hidden" name="flightId" value="<%=flightId %>" required>
        <input type="submit" value="提交">
    </form>
</div>
</body>
</html>